package jssia.database.mysql.columns;

public final class CharColumn extends StringColumn {

    private static final int MAX_CHARS = 255;
    private final int maxChars;

    public CharColumn(int maxChars) {
        if (maxChars > MAX_CHARS)
            throw new IllegalArgumentException("The requested string length of " + maxChars + " for column "
                    + fullyQualifiedName + " is too long.  The maximum length is " + MAX_CHARS);

        this.maxChars = maxChars;
    }

    @Override
    public long getMaxLength() {
        return maxChars;
    }
}
